home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10358 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: grouper.Exis.Net!usenet
  2. From: herborn@exis.net (Steve Herborn)
  3. Newsgroups: comp.lang.c
  4. Subject: Req:  Help with coding assignment {Any C programmers who Bowl?}
  5. Date: Sun, 17 Mar 1996 05:53:50 GMT
  6. Organization: Exchange Information Systems Networks
  7. Message-ID: <314ba37b.25739637@news.exis.net>
  8. NNTP-Posting-Host: ppp-1-15.exis.net
  9. X-Newsreader: Forte Agent .99d/32.168
  10.  
  11. I can't seem to come up with the correct code segment for scoring a
  12. bowling game.
  13.  
  14. Where I am at;
  15.  
  16. I have an array to hold ball 1, ball 2, and frame scores
  17.  
  18. int score_sheet [3][10] 
  19.  
  20. where score_sheet[0][frame] is # of pins for ball #1
  21.  
  22.              score_sheet[1][frame] is # of pins for ball #2
  23.  
  24.              score_sheet[2][frame] is the total for that frame
  25.  
  26. All my code for inputing values and value checking is in place and
  27. works fine.  The computation of a frame total with no strike or spares
  28. after the first frame  was easy.  
  29.  
  30. score_sheet[2][frame] =
  31. score_sheet[2][frame-1]+score_sheet[0][frame]+score_sheet[1][frame]
  32.  
  33. However, computing the strikes and spares is gettin me all wraped
  34. around the axle on this one.
  35.  
  36. Any help is welcomed, flames are not.  
  37.  
  38. I didn't wait to the last minute to do this, just to the last minute
  39. to ask for help.    HELP!
  40.  
  41. TIA -- Steve
  42.